package com.study.zzedu.fragment.notice;

import android.content.Context;

import com.study.zzedu.base.BasePresenter;
import com.study.zzedu.base.BaseView;
import com.study.zzedu.http.OnResultListener;

/**
 * Created by kiros on 2020/9/3.
 */

public class NoticePresenter extends BasePresenter<NoticeContract.IView> {

    private NoticeModel nModel;
    public NoticePresenter(){
        this.nModel = new NoticeModel();
    }

    public void getInfoList(Context context){
        nModel.getInfoList(context,new OnResultListener() {
            @Override
            public void onSuccess(String result) {
                getView().getInfoListCallBack(result);
            }

            @Override
            public void onError(String error) {
                getView().getData(error);
            }
        });
    }

    public void getImgList(Context context){
        nModel.getImgList(context,new OnResultListener() {
            @Override
            public void onSuccess(String result) {
                getView().getImgList(result);
            }

            @Override
            public void onError(String error) {
                getView().getData(error);
            }
        });
    }
}
